﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using VaccineEbook.Models;

using VaccineEbook.Helpers;

namespace VaccineEbook.Controllers
{
    public class UserController : Controller
    {
        string _messageError = "";
        //
        // GET: /User/

        public ActionResult Index(int page = 1)
        {
            IEnumerable<Models.DBEntity.User> listUser = Models.DBEntity.User.GetAll(ref _messageError);
            if (listUser != null)
            {
                CustomPageList<Models.DBEntity.User> pagelist = new CustomPageList<Models.DBEntity.User>(listUser, page, Models.Constant.DEFAUT_PAGESIZE);
                return View(pagelist);
            }

            ViewBag.MessageError = _messageError;
            return View();            
        }

    }
}
